<!DOCTYPE html>

<html lang="en-US">
<@common.header/>
<link rel="shortcut icon" href="/favicon.ico"/>
<body class="page-sub-page page-create-account page-account" id="page-top">
<!-- Wrapper -->
<div class="wrapper">
    <!-- Navigation -->
    <@common.nav/>
    <!-- end Navigation -->
    <!-- Page Content -->
    <div id="page-content">
        <!-- Breadcrumb -->
        <div class="container">
            <ol class="breadcrumb">
                <li><a href="#">Home</a></li>
                <li class="active">注册</li>
            </ol>
        </div>
        <!-- end Breadcrumb -->

        <div class="container">
            <header><h1>注册账号</h1></header>
            <div class="row">
                <div class="col-md-4 col-sm-6 col-md-offset-4 col-sm-offset-3">
                    <h3>Account Type</h3>
                    <form role="form" id="form-create-account" method="post" enctype="multipart/form-data"
                          action="/user/register"  onsubmit="return  verifyInformation();">
                        <div class="radio" id="create-account-user">
                            <label>
                                <input type="radio" value="1" id="account-type-user" name="userType" required>普通用户
                            </label>
                        </div>
                        <div class="radio" id="agent-switch" data-agent-state="">
                            <label>
                                <input type="radio" value="2" id="account-type-agent" name="userType" required>经纪人
                            </label>
                        </div>
                        <#--<div id="agency" class="disabled">-->
                            <#--<div class="form-group">-->
                                <#--<label for="account-agency">选择经纪机构:</label>-->
                                <#--<select name="account-agency" id="account-agency">-->
                                    <#--<option value="0">请选择经纪机构</option>-->
                                    <#--<#list agencyList as agency>-->
                                        <#--<option value="${agency.agencyId}" >${agency.agencyName}</option>-->
                                    <#--</#list>-->
                                <#--</select>-->
                            <#--</div>-->
                        <#--</div>-->
                        <hr>
                        <div class="form-group">
                            <label for="form-create-account-full-name">姓名:</label>
                            <input type="text" class="form-control" id="form-create-account-full-name" name="userName"
                                   required>
                        </div>
                        <div class="form-group">
                            <label for="form-create-account-email">Email:</label>
                            <input type="email" class="form-control" id="form-create-account-email" name="userEmail"
                                   required>
                        </div>
                        <div class="form-group">
                            <label for="form-create-account-email">手机号:</label>
                            <input type="text" class="form-control" id="form-create-account-email" name="userPhone">
                        </div>
                        <div class="form-group">
                            <label for="form-create-account-password">密码:</label>
                            <input type="password" class="form-control" id="form-create-account-password" name="userPassword"
                                   required>
                        </div>
                        <div class="form-group">
                            <label for="form-create-account-confirm-password">确认密码:</label>
                            <input type="password" class="form-control" id="form-create-account-confirm-password"
                                   name="confirmPasswd" required>
                        </div>
                        <div class="form-group">
                            <label for="form-create-account-email">自我介绍:</label>
                            <textarea class="form-control" name="userAboutMe"></textarea>
                        </div>
                        <div class="form-group">
                            <label for="form-create-account-email">用户头像:</label>
                            <input id="file-upload" type="file" class="file" multiple="true" data-show-upload="false"
                                   data-show-caption="false" data-show-remove="false" accept="image/jpeg,image/png"
                                   data-browse-class="btn btn-default" data-browse-label="选择图片"
                                   name="file" >

                        </div>
                        <div class="form-group clearfix">
                            <button type="submit" class="btn pull-right btn-default" id="account-submit">注册账号</button>
                        </div>
                    </form>
                    <hr>

                </div>
            </div><!-- /.row -->
        </div><!-- /.container -->
    </div>
    <!-- end Page Content -->
    <!-- Page Footer -->
    <#--<@common.footer/>-->
    <!-- end Page Footer -->
</div>

<@common.js/>
<!--[if gt IE 8]>
<script type="text/javascript" src="/static/assets/js/ie.js"></script>
<![endif]-->
<script type="text/javascript">
    $(document).ready(function () {
        var errorMsg = "${errorMsg!""}";
        var successMsg = "${successMsg!""}";
        if (errorMsg) {
            errormsg("error", errorMsg);
        }
        if (successMsg) {
            successmsg("success", successMsg);
        }
    })

    function verifyInformation() {
        var password = document.getElementById("form-create-account-password").value;
        var confirm = document.getElementById("form-create-account-confirm-password").value;
        if (password == " " || password.length < 6) {
            alert("密码不能小于6位且不能为空字符串");
            return false;
        } else if (confirm == " " || confirm.length < 6) {
            alert("密码不能小于6位且不能为空字符串");
            return false;

        } else if (password != confirm) {
            alert("两次密码输入不一致");
            return false;
        }else {
            return true;
        }
    }

</script>
</body>
</html>